package com.boost.socialNetwork.server;


import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import com.google.appengine.api.datastore.Key;


@Entity
public class Idea implements Serializable{
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Key id;
	
	@ManyToOne(fetch = FetchType.EAGER)
	private User author;
	
	@Basic
	private Date date;
	
	@Basic
	private String title;
	
	@Basic
	private String content;
	
	@OneToMany(mappedBy = "idea", cascade = CascadeType.ALL)
	private List<Comment> comments;
	
	@Basic
	private List<String> toBeNtoified;
	
	
	public Idea(){}
	
	public Key getId() {
		return id;
	}

	public void setId(Key id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setAuthor(User author) {
		this.author = author;
	}

	public User getAuthor() {
		return author;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Date getDate() {
		return date;
	}

	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}

	public List<Comment> getComments() {
		return comments;
	}

	public void setToBeNtoified(List<String> toBeNtoified) {
		this.toBeNtoified = toBeNtoified;
	}

	public List<String> getToBeNtoified() {
		return toBeNtoified;
	}
	
}
